<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      //replace('被替换的','替换为的')
      var str = "north";
      console.log(str.replace("n", "b"));
      var str1 = "adwndipandoandopndaipgdawdwjgtdysbcnzcmoaudidg";
      while (str1.indexOf("d") !== -1) {
        str1 = str1.replace("d", "*");
      }
      console.log(str1);

      //字符串转化为数组split()
      var str2 = "red,blue,yellow";
      console.log(str2.split(","));
    </script>
  </head>
  <body></body>
</html>
